package com.atguigu.edu.controller;

import com.atguigu.commonutils.R;
import org.springframework.web.bind.annotation.*;

/**
 * 用户登录 前端控制器
 *
 * @author zhangsj
 * @date 2020/7/6 20:02
 */
@RestController
@RequestMapping("/edu/user")
@CrossOrigin
public class EduUserController {

    @PostMapping("/login")
    public R login(){
        return R.ok().data("token", "admin");
    }

    @GetMapping("/info")
    public R info(){
        return R.ok()
                .data("roles", "[admin]")
                .data("name", "zhangsan")
                .data("avatar","https://dss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3256100974,305075936&fm=26&gp=0.jpg");
    }
}
